package com.solocredit.finance.utils.track;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import java.util.List;

@Dao
public interface FlexiMolaTrackEventDao {
    @Insert
    void insert(FlexiMolaTrackEvent event);

    @Query("SELECT * FROM fleximola_track_events WHERE isReported = 0 ORDER BY timestamp ASC")
    List<FlexiMolaTrackEvent> getUnreportedEvents();

    @Update
    void updateEvents(List<FlexiMolaTrackEvent> events);

    @Query("DELETE FROM fleximola_track_events WHERE isReported = 1")
    void deleteReportedEvents();
}
